package com.mgface.thymeleaf.util;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 瑞士军刀的功能
 * 
 * @author yuxiang
 *
 */
public final class SwissKnife {
	private SwissKnife() {
	}

	public static String getBasePath(HttpServletRequest request, HttpServletResponse response) {
		String path = request.getContextPath();
		String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
		return basePath;
	}
}
